import request from '@/utils/request'

// 查询客户线索列表
export function listCustomermerchants(query) {
  return request({
    url: '/customermerchants/customermerchants/list',
    method: 'get',
    params: query
  })
}

// 查询客户线索列表
export function taskListCustomermerchants(query) {
  return request({
    url: '/customermerchants/customermerchants/task',
    method: 'get',
    params: query
  })
}

// 分派
export function reviewCustomermerchants(data) {
  return request({
    url: '/customermerchants/customermerchants/review',
    method: 'post',
    data: data
  })
}
// 查询客户线索列表
export function myListCustomermerchants(query) {
  return request({
    url: '/customermerchants/customermerchants/my',
    method: 'get',
    params: query
  })
}


// 查询客户线索详细
export function getCustomermerchants(id) {
  return request({
    url: '/customermerchants/customermerchants/' + id,
    method: 'get'
  })
}

// 新增客户线索
export function addCustomermerchants(data) {
  return request({
    url: '/customermerchants/customermerchants',
    method: 'post',
    data: data
  })
}

// 修改客户线索
export function updateCustomermerchants(data) {
  return request({
    url: '/customermerchants/customermerchants',
    method: 'put',
    data: data
  })
}

// 删除客户线索
export function delCustomermerchants(id) {
  return request({
    url: '/customermerchants/customermerchants/' + id,
    method: 'delete'
  })
}

//线索转客户
export function merchantsToCustomer(id) {
  return request({
    url: '/customermerchants/customermerchants/tocustomer/' + id,
    method: 'post'
  })
}
